/**  
 * @Title: Rank.java
 * @Package com.limit.model
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-3-31 下午02:17:18
 * @version V1.0
 */ 
package com.limit.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

/** 
 * 排行榜类型<br/>
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-3-31 下午02:17:18 
 * @version V1.0
 */

public class Rank extends Model<Rank> {

	
	public final static Rank dao = new Rank();

	/** 
	 * 取得所有记录列表
	 */
	public List<Rank> getAllList() {
		
		return Rank.dao.find("select * from rank order by sort_id desc");
	}
	
	/**
	 * disable=-1的正常显示列表
	 */
	public List<Rank> getViewList(){
		
		return Rank.dao.find("select * from rank where disable=? order by sort_id desc" , -1);
		
		
	}

	/** 
	 * 分页联合查询rank-game 
	 */
	public Page<Rank> complexQuery(long rank_id , int pageNow ,int pageSize) {
		return Rank.dao.paginate(
					pageNow, 
					pageSize, 
					"SELECT * " ,
					"FROM view_rank_games where rank_id =? order by sort_id desc",rank_id);
		
	}
	
	
	
}
